package com.example.lesson_10_25.service;

import com.example.lesson_10_25.mapper.RoleMapper;
import com.example.lesson_10_25.pojo.Role;
import com.example.lesson_10_25.pojo.User_Role;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;

/**
 * @PACKAGE_NAME: com.example.lesson_10_25.service
 * @NAME: RoleService
 * @USER: jiang000
 * @DATE: 2023/10/30
 **/

@Service
public class RoleService {
    @Autowired
    private RoleMapper roleMapper;

    public List<Role> getRoles(){
        return roleMapper.getRoles();
    }
    public void deleteRole(String rolename){
        roleMapper.deleteRole(rolename);
    }
    public void addRole(String rolename, String permission_name){
        roleMapper.addRole(rolename, permission_name);
    }

    public void addnewRole(String rolename, String description){
        roleMapper.addnewRole(rolename, description);
    }
    public void updateDescription(String rolename, String description){
        roleMapper.updateDescription(rolename, description);
    }
}
